<div class="nice_pageination clearfix">
    <table cellspacing="0" cellpadding="0" border="0" >
        <tr>
            <td><a {$local_page=false}{if $page.current_page>1}{$local_page=true}{/if} {if $local_page}href="{U($args,['page'=>1])}" data-tip-type="1" data-tip-text="首页" {else}href="javascript:void(0);"{/if} class="prev-first-page nice-link {if !$local_page}disabled-link{else}tooltip{/if}"><span><i></i></span></a></td>
            <td><a {$local_page=false}{if $page.current_page>1}{$local_page=true}{/if} {if $local_page}href="{U($args,['page'=>$page.current_page-1])}" data-tip-type="1" data-tip-text="上页" {else}href="javascript:void(0);"{/if} class="prev-page nice-link {if !$local_page}disabled-link{else}tooltip{/if}"><span><i></i></span></a></td>
            <td><div class="separator mr"></div></td>
            <td><span>第</span></td>
            <td><input id="goPage" size="2" {if $page.current_page}value="{$page.current_page}"{else}value="0"{/if} max="{$page.last_page}"/>{$page.$mdl.page}页</td>
            <td>共{$page.last_page}页</td>
            <td><div class="separator ml"></div></td>
            <td><a {$local_page=false}{if $page.current_page<$page.last_page}{$local_page=true}{/if} {if $local_page}href="{U($args,['page'=>$page.current_page+1])}" data-tip-type="1" data-tip-text="下页" {else}href="javascript:void(0);"{/if} class="next-page nice-link {if !$local_page}disabled-link{else}tooltip{/if}"><span><i></i></span></a></td>
            <td><a {$local_page=false}{if $page.current_page<$page.last_page}{$local_page=true}{/if} {if $local_page}href="{U($args,['page'=>$page.last_page])}" data-tip-type="1" data-tip-text="尾页" {else}href="javascript:void(0);"{/if} class="next-last-page nice-link {if !$local_page}disabled-link{else}tooltip{/if}"><span><i></i></span></a></td>
            <td><div class="separator"></div></td>
            <td><a href="javascript:void(0);" class="page-refresh nice-link tooltip" data-tip-text="刷新" data-tip-type="1" style="display: none;"><span><i></i></span></a></td>
        </tr>
    </table>
    {if $page.total}
    {$page_form=($page.current_page-1)*$page.per_page+1}
    {$page_to=$page_form+$page.per_page-1}
    {else}
    {$page_form=0}
    {$page_to=0} 
    {/if}                
    <div class="pageination-info" {if config('app_trace')}style="margin-right: 100px;"{/if}>显示{$page_form}到{$page_to},共{$page.total}记录</div> 
</div>
<script>
function goto_to_page(){
    var page_num = $('#goPage').val();
    var url ="{U(['action'=>'lists'],['page'=>'REPLACE_URL'])}";
    location.href   = url.replace('REPLACE_URL',page_num) ;
}

$('#goPage').keydown(function(event){
	if(event.keyCode==13){
		goto_to_page();
		return false;
	}
}).blur(function(){
   var val = $(this).val() ;
   var page = {$page.current_page};
   if(val != page)goto_to_page();
})

$('#goPage').keyup(function(){
    var max_page=parseInt($('#goPage').attr('max'));
    var target_page=$('#goPage').val();
    if(!/\d{ldelim}1,}/.test(target_page)){
        target_page  = 1;
    }else{
        target_page=parseInt(target_page);
    }
    if(target_page>max_page)target_page=max_page;
    $('#goPage').val(target_page);
})

$('.nice_pageination .page-refresh').click(function(){
    $(this).remove();
    location.reload();
})


setTimeout(function(){
    $('.nice_pageination .page-refresh').fadeIn(300) ;
},2000)
</script>